package user

import (
	"beegoProject03/models/user"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
)

type UserController struct {
	beego.Controller
}

func (c *UserController) Get() {

	o := orm.NewOrm()
	qs := o.QueryTable("sys_user")

	// 切片保存查询结果
	users := []user.User{}

	// 查询 is_delete 是 0 的 所有
	qs.Filter("is_delete", 0).All(&users)

	c.Data["users"] = users

	c.TplName = "user/user-list.html"
}
